<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl;?>/js/jquery.metadata.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl;?>/js/mbMenu.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl;?>/js/jquery.hoverIntent.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl;?>/css/menu_red.css" media="screen" />

<style type="text/css">
	body .style a{
		color:gray;
		font-family:sans-serif;
		font-size:13px;
		text-decoration:none;
	}
   .menu{
     display:none;
   }
</style>

<script type="text/javascript">

	/*
	* DEFAULT OPTIONS
	*
		options: {
		template:"yourMenuVoiceTemplate", --> the url that returns the menu voices via ajax. the data passed in the request is the "menu" attribute value as "menuId"
		additionalData:"",								--> if you need additional data to pass to the ajax call
		menuSelector:".menuContainer",		--> the css class for the menu container
		menuWidth:150,										--> min menu width
		openOnRight:false,								--> if the menu has to open on the right insted of bottom
		iconPath:"ico/",									--> the path for the icons on the left of the menu voice
		hasImages:true,										--> if the menuvoices have an icon (a space on the left is added for the icon)
		fadeInTime:100,										--> time in milliseconds to fade in the menu once you roll over the root voice
		fadeOutTime:200,									--> time in milliseconds to fade out the menu once you close the menu
		menuTop:0,												--> top space from the menu voice caller
		menuLeft:0,												--> left space from the menu voice caller
		submenuTop:0,											--> top space from the submenu voice caller
		submenuLeft:4,										--> left space from the submenu voice caller
		opacity:1,												--> opacity of the menu
		shadow:false,											--> if the menu has a shadow
		shadowColor:"black",							--> the color of the shadow
		shadowOpacity:.2,									--> the opacity of the shadow
		openOnClick:true,									--> if the menu has to be opened by a click event (otherwise is opened by a hover event)
		closeOnMouseOut:false,						--> if the menu has to be cloesed on mouse out
		closeAfter:500,										--> time in millisecond to whait befor closing menu once you mouse out
		minZindex:"auto", 								--> if set to "auto" the zIndex is automatically evaluate, otherwise it start from your settings ("auto" or int)
		hoverInted:0, 										--> if you use jquery.hoverinted.js set this to time in milliseconds to delay the hover event (0= false)
		onContextualMenu:function(o,e){} 	--> a function invoked once you call a contextual menu; it pass o (the menu you clicked on) and e (the event)
	},
	*/


	$(function(){
		$(".myMenu").buildMenu(
		{
			//template:"menuVoices.html",
			additionalData:"pippo=1",
			menuWidth:200,
			openOnRight:false,
			menuSelector: ".menuContainer",
			containment:"wrapper",
			iconPath:"<?php echo Yii::app()->request->baseUrl;?>images/menu/",
			hasImages:true,
			fadeInTime:100,
			fadeOutTime:300,
			adjustLeft:2,
			minZindex:"auto",
			adjustTop:10,
			opacity:.95,
			shadow:true,
			closeOnMouseOut:true,
			closeAfter:1000
		});
	});

</script>
<?php $role = $this->session->userdata('ROLE'); ?>
<div class="myMenu">
	<!-- start horizontal menu -->
	<table class="rootVoices" cellspacing='0' cellpadding='0' border='0'>
		<tr>
			<td class="rootVoice {menu: 'Home'}" >Home &nbsp;<img style="position:absolute;" src="<?php echo Yii::app()->request->baseUrl;?>images/menu/home.png"/></td>
			<td class="rootVoice {menu: 'Master'}" >Master &nbsp;<img style="position:absolute;" src="<?php echo Yii::app()->request->baseUrl;?>images/menu/master.png"/></td>
			<td class="rootVoice {menu: 'Simpanan'}" >Simpanan &nbsp;<img style="position:absolute;" src="<?php echo Yii::app()->request->baseUrl;?>images/menu/gudang.png"/></td>
			<td class="rootVoice {menu: 'Pinjaman'}" >Pinjaman &nbsp;<img style="position:absolute;" src="<?php echo Yii::app()->request->baseUrl;?>images/menu/produksi.png"/></td>
			<!-- <td class="rootVoice {menu: 'Pos'}" >Point of Sales &nbsp;<img style="position:absolute;" src="<?php echo Yii::app()->request->baseUrl;?>images/menu/pos.png"/></td> -->
			<td class="rootVoice {menu: 'Keuangan'}" >Keuangan &nbsp;<img style="position:absolute;" src="<?php echo Yii::app()->request->baseUrl;?>images/menu/keuangan.png"/></td>
			<!--<td class="rootVoice {menu: 'Pegawai'}" >Pegawai &nbsp;<img style="position:absolute;" src="<?php echo Yii::app()->request->baseUrl;?>images/menu/pegawai.png"/></td>-->
		</tr>
	</table>		
	<!-- end horizontal menu -->
</div>

<!-- menues -->
<div id="Home" class="menu">
	<a href="<?=site_url('home');?>" class="{img: 'iconhome/home.png'}">Home</a>
	<a href="<?=site_url('user/user_management');?>" class="{img: 'iconhome/ubah_password.png'}">Ubah Password</a>
	<a href="<?=site_url('deabakery/logout');?>" class="{img: 'iconhome/log_out.png'}">Logout</a>
</div>

<div id="Master" class="menu">
	<a href="<?=site_url('anggota/anggota');?>" class="{img: 'iconmaster/pegawai.png'}">Anggota</a>
	<a href="<?=site_url('pegawai/pegawai');?>" class="{img: 'iconmaster/pegawai.png'}">Pegawai</a>
<!--	<a href="<?=site_url('gudang/bahan_baku');?>" class="{img: 'iconmaster/bahan_baku.png'}">Bahan Baku</a>
	<a href="<?=site_url('supplier/supplier');?>" class="{img: 'iconmaster/supplier.png'}">Supplier</a>
	<a href="<?=site_url('produksi/kategori_barang');?>" class="{img: 'iconmaster/kategori_barang.png'}">Kategori Barang</a>
	<a href="<?=site_url('produksi/barang');?>" class="{img: 'iconmaster/barang.png'}">Barang</a>
	<a href="<?=site_url('produksi/harga_barang');?>" class="{img: 'iconmaster/harga_barang.png'}">Harga Barang</a>
	<a href="<?=site_url('produksi/konsinyasi');?>" class="{img: 'iconmaster/konsinyasi.png'}">Konsinyasi</a>
	<a href="<?=site_url('produksi/harga_konsinyasi');?>" class="{img: 'iconmaster/harga_konsinyasi.png'}">Harga Konsinyasi</a> -->
	<a href="<?=site_url('keuangan/akun');?>" class="{img: 'iconmaster/akun_keuangan.png'}">Akun Keuangan</a>
	<a href="<?=site_url('user/user');?>" class="{img: 'iconmaster/user.png'}">User</a>

</div>

<div id="Simpanan" class="menu">
	<a href="<?=site_url('gudang/order_bahan_baku');?>" class="{img: 'icongudang/order_bahan_baku.png'}">Simpanan Wajib</a>
	<a href="<?=site_url('gudang/stock_produksi/data_stock_produksi');?>" class="{img: 'icongudang/stock_divisi.png'}">Simpanan Sukarela</a>
	<!--<a href="<?=site_url('produksi/penerimaan_konsinyasi');?>" class="{img: 'icongudang/penerimaan_konsinyasi.png'}">Penerimaan Konsinyasi</a>
	<a rel="separator"> </a>
	<a href="<?=site_url('gudang/laporan/laporan_penerimaan_stock_gudang');?>" class="{img: 'icongudang/laporan_stock_gudang.png'}">Laporan Penerimaan Stock Gudang</a>
	<a href="<?=site_url('gudang/laporan/laporan_stock_divisi');?>" class="{img: 'icongudang/laporan_stock_divisi.png'}">Laporan Stock Divisi</a>
	<a href="<?=site_url('gudang/laporan/laporan_rekap_stock_gudang');?>" class="{img: 'icongudang/laporan_rekap_gudang.png'}">Laporan Rekap Stock Gudang</a> -->
</div>

<div id="Pinjaman" class="menu">
	<a href="<?=site_url('produksi/permintaan_produksi');?>" class="{img: 'iconproduksi/permintaan_produksi.png'}">Daftar Pinjaman</a>
	<a href="<?=site_url('produksi/manajemen_produksi');?>" class="{img: 'iconproduksi/management_produksi.png'}">Daftar Peminjam</a>
	<!--<a href="<?=site_url('produksi/waste');?>" class="{img: 'iconproduksi/waste.png'}">Waste</a>
	<a rel="separator"> </a>
	<a href="<?=site_url('produksi/laporan/laporan_waste');?>" class="{img: 'iconproduksi/laporan_waste.png'}">Laporan Waste</a>
	<a href="<?=site_url('produksi/laporan/laporan_hasil_produksi');?>" class="{img: 'iconproduksi/laporan_produksi.png'}">Laporan Hasil Produksi</a>
	<a href="<?=site_url('produksi/laporan/laporan_permintaan_bahan_baku');?>" class="{img: 'iconproduksi/laporan_permintaan_bahan_baku.png'}">Laporan Permintaan Bahan Baku</a>
	<a href="<?=site_url('produksi/laporan/laporan_bahan_baku_yang_digunakan');?>" class="{img: 'iconproduksi/laporan_bahan_baku.png'}">Laporan Bahan Baku yang Digunakan</a>-->
</div>

<div id="Pos" class="menu">
<?php if ($role === '1' || $role === '2' || $role === '3' || $role === '4') { ?>
	<a href="<?=site_url('member/member');?>" class="{img: 'iconpenjualan/anggota.png'}">Member</a>
	<a href="<?=site_url('pos/pemesanan');?>" class="{img: 'iconpenjualan/pemesanan.png'}">Pemesanan</a>
	<a href="<?=site_url('pos/penjualan/pos');?>" class="{img: 'iconpenjualan/penjualan.png'}">POS</a>
<?php }
	  if ($role === '1' || $role === '2' || $role === '3') { ?>
	<a rel="separator"> </a>
	<a href="<?=site_url('pos/laporan/laporan_penjualan_harian');?>" class="{img: 'iconpenjualan/laporan_penjualan_harian.png'}">Laporan Penjualan Harian</a>
	<a href="<?=site_url('pos/laporan/laporan_rekap_penjualan_harian');?>" class="{img: 'iconpenjualan/laporan_rekap_penjualan_harian.png'}">Laporan Rekap Penjualan Harian</a>
	<a href="<?=site_url('pos/laporan/laporan_data_pelanggan_harian');?>" class="{img: 'iconpenjualan/laporan_data_pelanggan.png'}">Laporan Data Pelanggan Harian</a>
	<a href="<?=site_url('pos/laporan/laporan_bonus_roti');?>" class="{img: 'iconpenjualan/laporan_bonus_roti.png'}">Laporan Bonus Roti</a>
	<a href="<?=site_url('pos/laporan/laporan_penjualan_lengkap');?>" class="{img: 'iconpenjualan/laporan_penjualan_lengkap.png'}">Laporan Penjualan Lengkap</a>
<?php } ?>
</div>

<div id="Keuangan" class="menu">
	<a href="<?=site_url('keuangan/transaksi');?>" class="{img: 'iconkeuangan/menu_transaksi.png'}">Transaksi</a>
	<a href="<?=site_url('keuangan/kasbon');?>" class="{img: 'iconkeuangan/kasbon.png'}">Kasbon</a>
	<a rel="separator"> </a>
	<a href="<?=site_url('');?>" class="{img: 'iconkeuangan/laporan_keuangan.png'}">Laporan Keuangan</a>
	<a href="<?=site_url('keuangan/laporan/laba_rugi');?>" class="{img: 'iconkeuangan/laporan_keuangan.png'}">Laporan Laba-Rugi</a>
	<a href="<?=site_url('keuangan/laporan/buku_besar');?>" class="{img: 'iconkeuangan/laporan_keuangan.png'}">Laporan Buku Besar</a>
	<a href="<?=site_url('keuangan/laporan/neraca');?>" class="{img: 'iconkeuangan/laporan_keuangan.png'}">Laporan Neraca</a>
</div>

<div id="Pegawai" class="menu">
	<a href="<?=site_url('pegawai/absensi');?>" class="{img: 'iconpegawai/absensi.png'}">Absensi</a>
	<a rel="separator"> </a>
	<a href="<?=site_url('pegawai/laporan/laporan_absensi');?>" class="{img: 'iconpegawai/laporan_absensi.png'}">Laporan Absensi</a>
</div>

<!-- end menues -->
